local gamelib = require "club.threecard.gamelib"
local game = require "club.threecard.sudoku"

return
{
    routes = 
    {
        -- 游戏主入口
        {
            path = "/club.threecard.sudoku/main",
            redirect = "/club.threecard.sudoku/main/home",
            components =
            {
                default = function() 
                    return game.require "ui.main.MainUI"
                end,
                background = function()
                    return game.require "ui.common.Background"
                end
            },
            children = {
                {
                    path = "home",
                    meta = {
                        res = "club.threecard.sudoku/ui/main.b:tab-bar-item-home"
                    },
                    component = function()
                        return game.require "ui.main.Home"
                    end
                },
                {
                    path = "profile",
                    meta = {
                        res = "club.threecard.sudoku/ui/main.b:tab-bar-item-profile"
                    },
                    component = function()
                        return game.require "ui.main.Profile"
                    end
                },
                {
                    path = "setting",
                    meta = {
                        res = "club.threecard.sudoku/ui/main.b:tab-bar-item-setting"
                    },
                    component = function()
                        return game.require "ui.main.Setting"
                    end
                },
                {
                    path = "feedback",
                    meta = {
                        res = "club.threecard.sudoku/ui/main.b:tab-bar-item-feedback"
                    },
                    component = function()
                        return game.require "ui.main.Feedback"
                    end
                }
            }
        },

        -- 房间列表
        {
            path = "/club.threecard.sudoku/rooms",
            components =
            {
                default = function() 
                    return gamelib.require "UI.RoomLobby.RoomLobbyUI"
                end,
                background = function()
                    return require "ui.Background.Background"
                end
            }
        },

        -- 挑战对局列表
        {
            path = "/club.threecard.sudoku/versus-list",
            components =
            {
                default = function() 
                    return game.require "ui.versus.VersusUI"
                end,
                background = function()
                    return game.require "ui.common.BlankBackground"
                end
            }
        },

        -- 挑战对局详情
        {
            path = "/club.threecard.sudoku/versus-detail/(?<id>\\w+)",
            components =
            {
                default = function() 
                    return game.require "ui.versus.DetailUI"
                end,
                background = function()
                    return game.require "ui.common.BlankBackground"
                end
            }
        },

        -- 游戏内界面
        {
            path = "/club.threecard.sudoku/ingame",
            components = 
            {
                background = function() return require "ui.Background.Background"  end,
                default = function()
                    return game.require "ui.ingame.InGameUI"
                end
            }
        },

        -- 结算界面
        {
            path = "/club.threecard.sudoku/settlement",
            components = 
            {
                popup = function()
                    return game.require "ui.settlement.SettlementUI"
                end
            }
        },
    }
}